﻿using Dapper;
using System;
using BCEntity.OA.WorkflowActive.WorkflowActivityStepReviewer;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.OA.WorkflowActive.WorkflowActivityStepReviewer
{
	/// <summary>
	/// 工作流活动步骤审核人
	/// </summary>
	public interface IWorkflowActivityStepReviewerData
	{
		#region  成员方法
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		/// <param name="workflowActivityStepReviewerId">工作流活动步骤审核人Id</param>
		Task<bool> Exists(long workflowActivityStepReviewerId);
		/// <summary>
		/// 增加工作流活动步骤审核人
		/// </summary>
		/// <param name="entity">工作流活动步骤审核人信息</param>
		Task<WorkflowActivityStepReviewerEntity> Add(WorkflowActivityStepReviewerEntity entity);
		/// <summary>
		/// 增加工作流活动步骤审核人
		/// </summary>
		/// <param name="entities">工作流活动步骤审核人信息列表</param>
		Task<bool> Add(List<WorkflowActivityStepReviewerEntity> entities);
		
		/// <summary>
		/// 更新工作流活动步骤审核人
		/// </summary>
		/// <param name="entity">工作流活动步骤审核人信息</param>
		Task<WorkflowActivityStepReviewerEntity> Update(WorkflowActivityStepReviewerEntity entity);
		/// <summary>
		/// 删除工作流活动步骤审核人
		/// </summary>
		/// <param name="workflowActivityStepReviewerId">工作流活动步骤审核人Id</param>
		Task<bool> Delete(long workflowActivityStepReviewerId);
		/// <summary>
		/// 获取工作流活动步骤审核人
		/// </summary>
		/// <param name="workflowActivityStepReviewerId">工作流活动步骤审核人Id</param>
		Task<WorkflowActivityStepReviewerEntity> GetEntity(long workflowActivityStepReviewerId);
		/// <summary>
		/// 获取工作流活动步骤审核人
		/// </summary>
		/// <param name="workflowActivityStepId">工作流活动步骤Id</param>
		Task<WorkflowActivityStepReviewerEntity> GetEntityByStepId(long workflowActivityStepId);
		/// <summary>
		/// 获取工作流活动步骤审核人列表
		/// </summary>
		Task<IEnumerable<WorkflowActivityStepReviewerEntity>> GetList();
		/// <summary>
		/// 获取工作流活动步骤审核人分页列表
		/// </summary>
		/// <param name="start">开始时间</param>
		/// <param name="end">结束时间</param>
		/// <param name="sortName">排序字段</param>
		/// <param name="ascending">升序</param>
		/// <param name="pageIndex">当前页码</param>
		/// <param name="pageSize">每页数据条数</param>
		Task<(IEnumerable<WorkflowActivityStepReviewerEntity>, int)> Query(DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
		/// <summary>
		/// 获取工作量最少的审核人信息
		/// </summary>
		/// <param name="companyId">公司Id</param>
		/// <returns></returns>
		Task<WorkflowActivityStepReviewerEntity> GetWorkMinimumReviewerByCompanyId(int companyId);
		/// <summary>
		/// 获取工作量最少的审核人信息
		/// </summary>
		/// <param name="departmentId">部门Id</param>
		/// <returns></returns>
		Task<WorkflowActivityStepReviewerEntity> GetWorkMinimumReviewerByDepartmentId(int departmentId);
		/// <summary>
		/// 获取工作量最少的审核人信息
		/// </summary>
		/// <param name="adminIds">人员Ids</param>
		/// <returns></returns>
		Task<WorkflowActivityStepReviewerEntity> GetWorkMinimumReviewerByAdminId(List<long> adminIds);
		#endregion  成员方法
	}


}